import * as React from 'react';
import { Button, Modal } from 'antd';
import http from '../utils/http';


interface Props {
    id: string
}

const IUserId: React.FC<Props> = ({ id }: Props) => {
    const userModal = async () => {
        let { data } = await http.get(`/admin/users/${id}`);
        Modal.confirm({
            title: '用户信息',
            content: (
                <div>
                    <p>电话号码:{data.data.mobile}</p>
                    <p>邮箱:{data.data.email}</p>
                    <p>注册时间:{data.data.createTime}</p>
                </div>
            ),
            okText: '确认',
            cancelText: '取消',
        });
    }

    return (
        <Button onClick={userModal} type="link">
            {id}
        </Button>
    );

}

export default IUserId;